﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderList.aspx.cs" Inherits="Pages_Admin_OrderList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 <script type="text/javascript"  src="../../JS/datatime.js"></script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <fieldset style="width:730px; padding:10px">
<legend>筛选条件</legend>
<label>城市：</label>
<asp:DropDownList ID="ddlcity" runat="server" DataSourceID="odsCity" 
        DataTextField="CityName" DataValueField="CityID" AutoPostBack="True" >
                    </asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    支付状态：<asp:DropDownList ID="ddlPay" runat="server" >
                    <asp:ListItem Value="7">已经支付</asp:ListItem>
                    <asp:ListItem Value="1">-未支付-</asp:ListItem>
                    <asp:ListItem Value="0">--所有--</asp:ListItem>
                    </asp:DropDownList>&nbsp;&nbsp;
                      <label style="margin-left:10px">日期：</label>&nbsp;&nbsp;
                      <asp:TextBox ID="txtdate"  runat="server" onselectstart="return false;" onkeypress="return false" onfocus="setday(this)" ></asp:TextBox><br />
                      商品:<asp:DropDownList ID="ddlProducts" runat="server" DataSourceID="odsProducts"   Width="370px"
        DataTextField="ProductName" DataValueField="ProductID"> </asp:DropDownList>
                  <asp:Button ID="Button1" runat="server" Height="29px" Text="搜索" Width="114px" onclick="Button1_Click" />
                  </fieldset>
           <br />
           <pan:SmartGridView ID="gdvInfoList" runat="server"  
            AllowPaging="True" AllowSorting="True"  AutoGenerateColumns="False" DataSourceID="odsorderList"
        PageSize="15"  BorderWidth="1px" BackColor="White" 
            BorderColor="#999999" BorderStyle="None" CellPadding="3" 
             GridLines="Vertical" DataKeyNames="OrderID" >
         <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
         <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        <Columns>
                      <asp:HyperLinkField DataNavigateUrlFields="OrderID" 
                    DataNavigateUrlFormatString="orderdetails.aspx?id={0}" 
                    DataTextField="OrderNum" HeaderText="订单号" SortExpression="OrderNum" />
                <asp:HyperLinkField DataNavigateUrlFields="ProductID" 
                    DataNavigateUrlFormatString="productdetail.aspx?id={0}"  DataTextFormatString="{0}"
                    DataTextField="ProductName" HeaderText="产品名称" SortExpression="ProductID" >
                      <ItemStyle Width="150px"  />
                      
                      </asp:HyperLinkField>
                <asp:BoundField DataField="Price" HeaderText="单价" 
                    SortExpression="Price" DataFormatString="{0:￥.0}" />
                     <asp:BoundField DataField="Count" HeaderText="数量" 
                    SortExpression="Count" />
                     <asp:BoundField DataField="TotalAmount" HeaderText="总价" 
                    SortExpression="TotalAmount"  DataFormatString="{0:￥.0}" >
                      <ItemStyle ForeColor="#0066FF" />
                      </asp:BoundField>
                     <asp:BoundField DataField="Freight" HeaderText="运费" 
                    SortExpression="Freight" />
                     <asp:BoundField DataField="Token" HeaderText="M币" 
                    SortExpression="Token" />
                      
                      <asp:BoundField DataField="PayMoney" HeaderText="支付总额" 
                    SortExpression="PayMoney"  DataFormatString="{0:￥.0}"  >
                      <ItemStyle ForeColor="Red" />
                      </asp:BoundField>
                    <asp:BoundField DataField="CheckName" HeaderText="收件人" 
                    SortExpression="CheckName" />
                <asp:TemplateField HeaderText="删除" Visible="false">
                    <ItemTemplate>
                        <asp:LinkButton CommandName="Delete" Text="删除" OnClientClick="javascript:return confirm('你确认要删除此商户吗！')" runat="server" ID="delCmd"></asp:LinkButton>
                    </ItemTemplate></asp:TemplateField>
                   </Columns>
                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <EmptyDataTemplate>
        <div style='text-align:left;margin-left:20px; width:100%;:20px;margin-bottom:10px;'>
		   <p style='color:#FF4E00;font-size:14px;font-weight:bold;'> 抱歉！没有搜索到相关信息 ！<br /><br /></p>
			可能的原因有：<br />
			1、不匹配<br />
			2、没有满足搜索条件的信息。<br /></div>
        </EmptyDataTemplate>
         <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <CustomPagerSettings PagingMode="Webabcd" TextFormat="每页{0}条/共{1}条  第{2}页/共{3}页   " />
        <PagerSettings Position="Bottom" PageButtonCount="13" FirstPageText="首页" PreviousPageText="上一页"
            NextPageText="下一页" LastPageText="末页" />
         <AlternatingRowStyle BackColor="#DCDCDC" />
         <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
    </pan:SmartGridView>
        <br />
        <asp:ObjectDataSource ID="odsCity" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllList" 
            TypeName="Tuan.BLL.City"></asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsProducts" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetListByCityID" 
            TypeName="Tuan.BLL.Products">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlcity" Name="cityid" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsorderList" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetListByKeys" 
            TypeName="Tuan.BLL.OrderInfo">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlcity" Name="cityid" 
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlPay" Name="paystuats" 
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="txtdate" Name="date" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="ddlProducts" Name="productid" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
